package com.xdxc.controller;


import com.xdxc.model.dto.ExamPaperDto;
import com.xdxc.model.dto.PaperDto;
import com.xdxc.response.Result;
import com.xdxc.service.PaperService;
import com.xdxc.vo.QuestionWithOptionsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/paper")
public class PaperController {

    @Autowired
    private PaperService paperService;

    @PostMapping("/save-paper")
    public Result savePaper(@RequestBody PaperDto paperDto) {
        boolean result = paperService.savePaper(paperDto);
        if (!result) {
            return Result.error("错误");
        }
        return Result.success("保存成功");
    }

    @GetMapping("/get-paper")
    public Result getPaper(@RequestParam Long id) {
        PaperDto result = paperService.getPaperExam(id);
        return Result.success(result);
    }





}